/*
*	New C++ File starts here.
*	This file should be named pose_datan_c_n.c
*/

/* Include all C language NML and CMS function prototypes. */
#include "nmlcms_c.h"

/* Include externally supplied prototypes. */
#include "pose_datan_c_n.h"

/* Forward Function Prototypes */
#ifdef __cplusplus
extern "C" {
#endif

void cms_PM_CARTESIAN_update(struct cms_c_struct *cms, nml_PM_CARTESIAN_c_t *x);
void cms_PM_RPY_update(struct cms_c_struct *cms, nml_PM_RPY_c_t *x);
void cms_POSE_DATA_MSG_update(struct cms_c_struct *cms, nml_POSE_DATA_MSG_c_t *x);

#ifdef __cplusplus
}
#endif
long nml_pose_data_open(const char *buf, const char *proc, const char *cfg)
{
	return (long) nml_new(pose_data_c_format, buf,proc,cfg);
}

int  nml_pose_data_valid(long nml_id)
{
	return (int) nml_valid( (nml_c_t) nml_id);
}

void nml_pose_data_close(long nml_id)
{
	nml_free( (nml_c_t) nml_id);
}

int nml_pose_data_read(long nml_id)
{
	return (long) nml_read( (nml_c_t) nml_id);
}

int nml_pose_data_POSE_DATA_MSG_write(long nml_id, const nml_POSE_DATA_MSG_c_t *msg){
	return (int) nml_write( (nml_c_t) nml_id,(void *) msg, (nmltype_c_t) 116000,sizeof(nml_POSE_DATA_MSG_c_t));
}

nml_POSE_DATA_MSG_c_t * nml_pose_data_POSE_DATA_MSG_get_msg(long nml_id){
	return (nml_POSE_DATA_MSG_c_t *) nml_get_address( (nml_c_t) nml_id);
}




#ifndef MAX_POSE_DATA_C_NAME_LENGTH
#define MAX_POSE_DATA_C_NAME_LENGTH 14
#endif
#ifndef POSE_DATA_C_NAME_LIST_LENGTH
#define POSE_DATA_C_NAME_LIST_LENGTH 2
#endif


/* This list must be in alphabetical order and the three lists must correspond. */
const char pose_data_c_name_list[POSE_DATA_C_NAME_LIST_LENGTH][MAX_POSE_DATA_C_NAME_LENGTH]= {
	"POSE_DATA_MSG", /* 0,116000 */
	""};
const NMLTYPE pose_data_c_id_list[POSE_DATA_C_NAME_LIST_LENGTH]= {
	POSE_DATA_MSG_TYPE, /* 0,116000 */
	-1};
const size_t pose_data_c_size_list[POSE_DATA_C_NAME_LIST_LENGTH]= {
	sizeof(nml_POSE_DATA_MSG_c_t),
	0};
const char *pose_data_c_symbol_lookup(long type);


/* Enumerated Type Constants */

/*
*	NML/CMS Format function : pose_data_c_format
*	Automatically generated by NML CodeGen Java Applet.
*	on Sat Feb 25 10:10:16 EST 2006
*/
int pose_data_c_format(long type, void *buffer, struct cms_c_struct *cms)
{

	type = cms_check_type_info(cms,type,buffer,"pose_data_c",
		(cms_symbol_lookup_function_t) pose_data_c_symbol_lookup,
		(const char **)pose_data_c_name_list,
		pose_data_c_id_list,pose_data_c_size_list,
		POSE_DATA_C_NAME_LIST_LENGTH,
		MAX_POSE_DATA_C_NAME_LENGTH);

	switch(type)
	{
	case POSE_DATA_MSG_TYPE:
		cms_POSE_DATA_MSG_update(cms,(nml_POSE_DATA_MSG_c_t *) buffer);
		break;

	default:
		return(0);
	}
	return 1;
}


/* NML Symbol Lookup Function */
const char *pose_data_c_symbol_lookup(long type)
{
	switch(type)
	{
	case POSE_DATA_MSG_TYPE:
		return "POSE_DATA_MSG";
	default:
		return"UNKNOWN";
		break;
	}
	return(NULL);
}

/*
*	NML/CMS Update function for POSE_DATA_MSG
*	Automatically generated by NML CodeGen Java Applet.
*	on Sat Feb 25 10:10:16 EST 2006
*/
void cms_POSE_DATA_MSG_update(struct cms_c_struct *cms, nml_POSE_DATA_MSG_c_t *x)
{

	cms_begin_class(cms,"POSE_DATA_MSG","NMLmsg");
	cms_begin_class_var(cms,"tran");
	cms_PM_CARTESIAN_update(cms, ( nml_PM_CARTESIAN_c_t *) &(x->tran));
	cms_end_class_var(cms,"tran");
	cms_begin_class_var(cms,"rpy");
	cms_PM_RPY_update(cms, ( nml_PM_RPY_c_t *) &(x->rpy));
	cms_end_class_var(cms,"rpy");

	cms_end_class(cms,"POSE_DATA_MSG","NMLmsg");

}

